package com.fingersoft.util;

import android.content.Context;

import com.fingersoft.feature.personal.api.UserDetailBean;
import com.fingersoft.im.R;
import com.fingersoft.im.api.model.UserInfo;


public class UserInfoHelper {
    public static UserInfo convertUserInfo(UserDetailBean data, Context context) {
        UserInfo userinfo = new UserInfo();
        userinfo.setDepartmentName(data.getDeptName());
        userinfo.setName(data.getName());
        userinfo.setIcon(data.getIcon());
        if (data.getGender().equals("MALE")) {
            userinfo.setGender(context.getString(R.string.business_male));
        } else if (data.getGender().equals("FEMALE")) {
            userinfo.setGender(context.getString(R.string.business_female));
        } else {
            userinfo.setGender("");
        }
        userinfo.setJob(data.getDutyName());
        userinfo.setEmployeeId(data.getId());
        userinfo.setPhone(data.getPhone());
        userinfo.setTelPhone(data.getMobile());
        userinfo.setEmail(data.getEmail());
        userinfo.setDeptId(data.getDeptId());
        userinfo.setDepartments(data.getDepartments());
        userinfo.setJobNumber(data.getJobNumber());
        return userinfo;
    }
}




